package Routers

import (
	"server5/Interface"
)

type UserServiceRouter struct {

}

func (u UserServiceRouter) Func(request Interface.IRequest) {

	//if request.GetConnection().User() == nil {
	//	fmt.Println("此用户还未登陆",request.GetConnection().User().UserInfo().UserName)
	//	return
	//}
	//var askUserInfoMsg protobuf.AskUserInfoMsg
	//proto.Unmarshal(request.GetData(),&askUserInfoMsg)
	//
	//userService := server.NewUserService(request.GetConnection().User().UserInfo())
	//
	//switch askUserInfoMsg.RequestType {
	//	case utils.UpgradeSoldierLevel:
	//		userService.UpgradeSoldierLevel(askUserInfoMsg.ParameterType)
	//	case utils.UpgradeSkillLevel:
	//		userService.UpgradeSkillLevel(askUserInfoMsg.ParameterType)
	//}
	//
	//var userInfoMsg protobuf.UserInfoMsg
	//nowUser,_ := Dao.GetUserDao().FindUserInfo(request.GetConnection().User().UserInfo().UserName)
	//
	//userInfoMsg.UserName = nowUser.UserName
	//userInfoMsg.CallBoss_Level = int32(nowUser.CallBossLevel)
	//userInfoMsg.UserSp = int32(nowUser.UserSp)
	//userInfoMsg.ReplayHp_Level = int32(nowUser.ReplyHpLevel)
	//userInfoMsg.Damage_Level = int32(nowUser.DamageLevel)
	//userInfoMsg.Infantry_Level = int32(nowUser.InfantryLevel)
	//userInfoMsg.Archer_Level = int32(nowUser.ArcherLevel)
	//userInfoMsg.UserGold = int32(nowUser.UserGold)
	//userInfoMsg.UserExp = int32(nowUser.UserExp)
	//userInfoMsg.UserLv = int32(nowUser.UserLv)
	//
	//request.GetConnection().SendMsg(protobuf.MsgType_UserInfo,&userInfoMsg)
}